package com.easyfun.healthmagicbox.bluetooth;

import android.content.Context;

import com.easyfun.healthmagicbox.bluetooth.enbp.EnBloodPressureHandler;
import com.easyfun.healthmagicbox.bluetooth.meng.MengHandler;
import com.easyfun.healthmagicbox.bluetooth.ycgi.YiChengGIHandler;
import com.easyfun.healthmagicbox.inputviews.HardwareInputActivity;
import com.easyfun.healthmagicbox.widget.zhuanpanView;

public class BTHandlerDispatcher {
	final private static  BTHandlerDispatcher instance = new BTHandlerDispatcher();
	static HardwareInputActivity parent;
	private BTHandlerDispatcher()
	{
		
	}
	public static BTHandlerDispatcher getInstance(HardwareInputActivity _parent)
	{
		parent = _parent;
		return instance;
	}
	
	public BTMessageHandler decideHandler(String devicename, String btmac,
			String personID, Context context)
	{
		if (devicename.startsWith("Bluetooth BP"))
		{
			return new EnBloodPressureHandler(personID, context,parent);
		}else if (devicename.startsWith("YiCheng"))
		{
			return new YiChengGIHandler(personID, context,parent);
		}else if (devicename.startsWith(""))
		{
			return new MengHandler(personID, context,parent);
		}
			
		return new MengHandler(personID, context,parent);
		
	}
}
